package com.api;

import com.alibaba.fastjson.annotation.JSONField;
import com.core.shared.TraceUtil;

/**
 * Created with IntelliJ IDEA.
 * User: lxf
 * Date: 2018/1/8
 * Time: 16:52
 * To change this template use Editor | File and Code Templates.
 */
public abstract class ApiResult {

    @JSONField(ordinal = 0)
    private String uuid;

    @JSONField(ordinal = 1)
    private String code;        //返回码

    @JSONField(ordinal = 2)
    private String msg;         //返回提示消息

    @JSONField(ordinal = 3)
    private Object data;        //返回的数据部分

    public ApiResult() {
        uuid = TraceUtil.getCurrentRequestTraceId();    //默认从当前线程的HttpRequest中提取
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}